IRCCMD:msg(botid, channel[], user[], host[], params[]) {
    new Msg[256],
        Client[256];
    
    if (!IRC_IsVoice(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need voice rights to execute this command!");
        return true;
    }
    
    if (sscanf(params, "s[128]", Msg)) {
        IRC_Say(g_ircBot, channel, "4Usage: '!msg <Message>'");
        return true;
    }
    
    format(Client, 256, "[IRC] %s: %s", user, Msg);
    SendClientMessageToAll(C_WHITE, Client);
    
    format(Client, 256, "3[IRC] 14%s1: 14%s", user, Msg);
    IRC_Say(g_ircBot, channel, Client);
    return true;
}

IRCCMD:players(botid, channel[], user[], host[], params[]) {
    if (!IRC_IsVoice(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need voice rights to execute this command!");
        return true;
    }
    
    new Pstr[1024],
        i_X;
        
    format(Pstr, 1024, "Online players:");
    
    foreach(Player, i) {
        format(Pstr, 1024, "%s 3%s (%d),", Pstr, playerName(i), i);
        i_X++;
    }
    
    if (i_X > 0) {
        format(Pstr, 1024, "10%s", Pstr);
        strdel(Pstr, strlen(Pstr) - 1, strlen(Pstr));
        IRC_Say(g_ircBot, channel, Pstr);
    }
    
    else {
        format(Pstr, 1024, "10Online players: 4No players online!");
        IRC_Say(g_ircBot, channel, Pstr);
    }
        
    return true;
}

IRCCMD:skick(botid, channel[], user[], host[], params[]) {
    new playerId,
        Reason[128];
        
    if (!IRC_IsOp(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need operator rights to execute this command!");
        return true;
    }
    
    if (sscanf(params, "us", playerId, Reason)) {
        IRC_Say(g_ircBot, channel, "4Usage: '!skick <PlayerID/Name> <Reason>'");
        return true;
    }
    
    if (!IsPlayerConnected(playerId)){
        IRC_Say(g_ircBot, channel, "4This player is not connected.");
        return true;
    }
    
    //kickEx(i_ID, user, Reason, false);
    Kick(playerId);
    IRC_Say(g_ircBot, channel, "3Kicked!");
    return true;
}

IRCCMD:sban(botid, channel[], user[], host[], params[]) {
    new playerId,
        Reason[128];
        
    if (!IRC_IsOp(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need operator rights to execute this command!");
        return true;
    }
    
    if (sscanf(params, "us", playerId, Reason)) {
        IRC_Say(g_ircBot, channel, "4Usage: '!sban <PlayerID/Name> <Reason>'");
        return true;
    }
    
    if (!IsPlayerConnected(playerId)) {
        IRC_Say(g_ircBot, channel, "4This player is not connected.");
        return true;
    }
    
    //kickEx(i_ID, user, Reason, true);
    BanEx(playerId, Reason);
    
    IRC_Say(g_ircBot, channel, "3Banned!");
    return true;
}

IRCCMD:rcon(botid, channel[], user[], host[], params[]) {
    new Cmd[128],
        Out[256];
        
    if (!IRC_IsOwner(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need owner rights to execute this command!");
        return true;
    }
    
    if (sscanf(params, "s[128]", Cmd)) {
        IRC_Say(g_ircBot, channel, "4Usage: '!rcon <Command>'");
        return true;
    }
    
    SendRconCommand(Cmd);
    format(Out, 256, "3RCON command '%s' successfuly executed.", Cmd);
    IRC_Say(g_ircBot, channel, Out);
    return true;
}

IRCCMD:raw(botid, channel[], user[], host[], params[]) {
    new Cmd[128],
        Out[256];
        
    if (!IRC_IsOwner(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need owner rights to execute this command!");
        return true;
    }
    
    if (sscanf(params, "s[128]", Cmd)) {
        IRC_Say(g_ircBot, channel, "4Usage: '!raw <Command>'");
        return true;
    }
    
    IRC_SendRaw(botid, Cmd);
    format(Out, 256, "3Raw command '%s' successfuly executed.", Cmd);
    IRC_Say(g_ircBot, channel, Out);
    return true;
}

IRCCMD:serverip(botid, channel[], user[], host[], params[]) {
    if (!IRC_IsVoice(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need voice rights to execute this command!");
        return true;
    }
    
    new IP[32],
        iPort,
        Out[128];
        
    GetServerVarAsString("bind", IP, 32);
    iPort = GetServerVarAsInt("port");
    format(Out, 128, "4Current server IP: 3%s:%d4! 3JOIN NOW!", IP, iPort);
    IRC_Say(g_ircBot, channel, Out);
    return true;
}
/*
IRCCMD:scores(botid, channel[], user[], host[], params[]) {
    if (!IRC_IsVoice(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need voice rights to execute this command!");
        return true;
    }
    
    new Out[256];
    format(Out, 256, "10Current team scores :: Home - %d / %s - Away | Round %d of %d", gameConfig[homeName], teamData[TEAM_HOME][iTeamScore], gameConfig[awayName], teamData[TEAM_AWAY][iTeamScore], (teamData[TEAM_HOME][iTeamScore] + teamData[TEAM_AWAY][iTeamScore]), gameConfig[iMaxScore]); 
    IRC_Say(g_ircBot, channel, Out);
    return true;
}

IRCCMD:teams(botid, channel[], user[], host[], params[]) {
    if (!IRC_IsVoice(botid, channel, user)) {
        IRC_Say(g_ircBot, channel, "4You need voice rights to execute this command!");
        return true;
    }
    
    new iH,
        iA,
        iR,
        iSubH,
        iSubA,
        Out[256];
        
    loop_players(i) {
        switch (playerData[i][team]) {
            case TEAM_HOME: iH++;
            case TEAM_HOME_SUB: iSubH++;
            case TEAM_AWAY: iA++;
            case TEAM_AWAY_SUB: iSubA++;
            case TEAM_REF: iR++;
        }
    }
    
    format(Out, 256, "10Current teams | %s - %d (%d subs) / %s - %d (%d subs) | %d referees", gameConfig[homeName], iH, iSubH, gameConfig[awayName], iA, iSubA, iR);
    IRC_Say(g_ircBot, channel, Out);
    return true;
}*/